<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<title>审计系统 - 项目资料</title>
		<link
			rel="stylesheet"
			href="{{ url_for('static', filename='css/style.css') }}"
		/>
	</head>
	<body>
		<div class="container">
			<!-- <div class="header-nav">
				<a href="{{ url_for('index') }}" class="btn btn-back">← 返回项目列表</a>
				<h1>项目资料管理</h1>
			</div> -->
			<div class="card">
				<a href="{{ url_for('index') }}" class="btn btn-back">返回项目列表</a>
				<h2>项目资料管理</h2>
				<!-- <h3>项目资料列表</h3> -->
				<div>
					<a
						href="{{ url_for('upload_project_document_form', project_id=project_id) }}"
						class="btn"
						>上传资料</a
					>
				</div>

				<table class="table">
					<thead>
						<tr>
							<th>ID</th>
							<th>名称</th>
							<th>类型</th>
							<th>上传时间</th>
							<th>操作</th>
						</tr>
					</thead>
					<tbody>
						{% for document in documents %}
						<tr>
							<td>{{ document.id }}</td>
							<td>{{ document.name }}</td>
							<td>{{ document.document_type }}</td>
							<td>{{ document.uploaded_at | local_time}}</td>
							<td>
								<a
									href="{{ url_for('download_file', file_path=document.file_path) }}"
									class="btn btn-sm"
									>下载</a
								>
							</td>
						</tr>
						{% endfor %}
					</tbody>
				</table>
			</div>
		</div>
	</body>
</html>
